# linux和windows共享目录
# 当windows里读写文件出现权限问题时，注意服务器文件权限问题
#
sudo apt-get install samba samba-common
sudo chmod -R 777 /home/wj/Public

groupadd samba_public -g 6000
useradd samba_public -u 6000 -g 6000 -s /sbin/nologin -d /dev/null
sudo smbpasswd -a samba_public  # wj

sudo sed -i '$a\[share]\ncomment = share folder\nbrowseable = yes\npath = /home/wj/Public/\ncreate mask = 0700\ndirectory mask = 0700\nvalid users = samba_public\npublic = yes\navailable = yes\nwritable = yes' /etc/samba/smb.conf

sudo service smbd restart
